<template>
  <div class="ship-container">
    <!-- <div class="ship-title">船舶动态</div> -->
    <div class="ship-content">
      <!-- 船舶动态内容 -->
      <dv-scroll-board :config="config" style="width: 100%; height: 100%" />
    </div>
  </div>
</template>

<script>
export default {
  name: "ShipComponent",
  data() {
    return {
      config: {
        header: ["#", "车次", "到站", "煤种", "预到时间"],
        data: [],
        columnWidth: [60, 110, 60, 120, 150],
        align: ["center", "center", "center", "center"],
        headerBGC: "transparent",
        oddRowBGC: "rgba(142, 201, 255, 0.1)",
        evenRowBGC: "rgba(142, 201, 255, 0.05)",
        rowNum: 6,
      },
    };
  },
  mounted() {
    this.initData();
  },
  methods: {
    initData() {
      const d = [
        ["1", "25124564", "黄村", "煤炭", "25-11-19 14:30"],
        ["2", "25124564", "黄村", "煤炭", "25-11-19 14:30"],
        ["3", "25124564", "黄村", "煤炭", "25-11-19 14:30"],
        ["4", "25124564", "黄村", "煤炭", "25-11-19 14:30"],
      ];
      d.forEach((item, index) => {
        if (index < 3) {
          item[0] = `<span class="listicon">${item[0]}</span>`;
        }
      });

      const config = JSON.parse(JSON.stringify(this.config));
      config.data = d;
      this.config = config;
    },
  },
};
</script>

<style scoped lang="scss">
// 表头元素设置
::v-deep .header-item {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 150px;
  box-sizing: border-box;
  text-align: center;
  font-size: 12px;
  font-family: SourceHanSansCN-Medium;
  letter-spacing: 1px;
  color: rgba(230, 247, 255, 0.65);
  font-weight: normal;
  font-style: normal;
  line-height: 1.5em;
  text-shadow: none;
  justify-content: center;
}
::v-deep .listicon {
  display: inline-block;
  width: 30px;
  height: 30px;
  background: url("~@/assets/images/tableListIcon.png") left center / 100% 100%
    no-repeat;
  line-height: 30px;
}
.ship-container {
  width: 100%;
  height: 100%;
  color: #fff;

  .ship-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
    color: #4bf3f9;
  }

  .ship-content {
    height: calc(100% - 30px);
    overflow: hidden;
  }
}
</style>
